package cn.credit.loan.service.blacklistuser;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.credit.loan.dao.blacklistuser.BlacklistuserMapper;
import cn.credit.loan.entity.Blacklistuser;
@Service
@Transactional
public class BlacklistuserServiceImpl implements BlacklistuserService {
	
	@Autowired
	public BlacklistuserMapper blacklistuserMapper;
	
	/**
	 * 黑名单添加
	 */
	@Override
	public boolean blacklistuserAdd(Blacklistuser blacklistuser) throws Exception {
		if(blacklistuser!=null)
		{
				int num=blacklistuserMapper.blacklistuserAdd(blacklistuser);
				if(num>0){
					return true;
				}
		}
		return false;
	}
	/**
	 * 黑名单更新
	 */
	@Override
	public boolean blacklistuserUpdate(Blacklistuser blacklistuser) throws Exception {
		if(blacklistuser!=null)
		{
				int num=blacklistuserMapper.blacklistuserUpdate(blacklistuser);
				if(num>0){
					return true;
				}
		}
		return false;
	}
	/**
	 * 黑名单删除
	 */
	@Override
	public boolean blacklistuserDelete(int blacklistId) throws Exception {
	
		return blacklistuserMapper.blacklistuserDelete(blacklistId);
	}
	/**
	 * 黑名单查询
	 */
	@Override
	public List<Blacklistuser> getBlacklistuserList(Blacklistuser blacklistuser) throws Exception {
		List<Blacklistuser> blacklist=blacklistuserMapper.getBlacklistuserList(blacklistuser);
		if(blacklistuser!=null)
		{
			return blacklist;
		}
		return null;
	}

}
